﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SilkeyERP.Model
{
    public partial class Customer
    {       
        public void SetNextAvailableCustomerCode()
        {
            using (var context = new SilkeyERPEntities())
            {
                CustomerCode = context.Customer.OrderBy(x => x.CustomerCode).ToList().Last().CustomerCode + 1;                
            }
        }
    }
}
